package com.study.socket.service;

import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Service;

/**
 * @author yuhuan
 * @date 2023/11/21
 */
@Service
public class RemindService {

    /**
     * 每5秒定时执行
     */
    @Scheduled(fixedRate = 5 * 1000)
    public void timedReminder() {
        String msg = "旋上旋下，右摇左三；今天宜摸鱼，不宜加班";
        WebSocketServer.broadcast(msg);
    }
}
